package lab01;

import java.util.Scanner;

public class Excise02 {

    String year;
    String month;
    String day;
    String id;

    public void inputId(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入身份证号：");
        id=scanner.nextLine();
    }
    public void cutId(){
        year = id.substring(6, 10);
        month = id.substring(10, 12);
        day = id.substring(12, 14);
    }

    public static void main(String[] args) {
        Excise02 e2 = new Excise02();
        e2.inputId();
        e2.cutId();
        System.out.println("生日是："+e2.year+"年"+ e2.month+"月"+e2.day+"日。");
    }

}

/*
输入身份证号：
140481245608074556
生日是：2456年08月07日。*/
